package com.xhh.reapply.controller.v1;

import com.xhh.model.common.dtos.ResponseResult;
import com.xhh.model.reapply.dtos.AddChoiceDto;
import com.xhh.model.reapply.dtos.FiltrateStudentDto;
import com.xhh.reapply.service.IScoreService;
import com.xhh.reapply.service.ReapplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@Api(tags = "成绩管理接口")
@RestController
@RequestMapping("/reapply/score")
@RequiredArgsConstructor
public class ScoreController {

    private final IScoreService scoreService;

    @ApiOperation("筛选考生")
    @GetMapping("/stu")
    public ResponseResult filtrateStudent(FiltrateStudentDto dto){
        return scoreService.filtrateStudent(dto);
    }

    @ApiOperation("根据准考证号查询成绩")
    @GetMapping("/{stuCode}")
    public ResponseResult getScoreByCode(@PathVariable("stuCode") String stuCode){
        return scoreService.getScoreByCode(stuCode);
    }

    @ApiOperation("获取考生详情")
    @GetMapping("/getStuInfo/{studentCode}")
    public ResponseResult getStuInfoById(@PathVariable("studentCode") String studentCode){
        return scoreService.getStuInfoById(studentCode);
    }

    @ApiOperation("判断考生是否上线")
    @GetMapping("/isOnline/{userId}")
    public ResponseResult isOnline(@PathVariable("userId") Long userId){
        return scoreService.isOnline(userId);
    }


}
